package com.cwh.taskcenter.domain.notice.strategy.impl;

import com.cwh.taskcenter.domain.notice.model.SendTaskNotification;
import com.cwh.taskcenter.domain.notice.strategy.NotificationStrategy;
import com.cwh.taskcenter.domain.system.domainservice.SmsSendDomainService;
import com.cwh.taskcenter.notice.sms.dto.SmsConfigDTO;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Component;

import java.util.Map;

/**
 * 短信通知策略实现
 * @author cwh
 */
@Component("SMS")
@AllArgsConstructor
public class SmsNotificationStrategy implements NotificationStrategy {

    private final SmsSendDomainService smsSendDomainService;

    @Override
    public void send(SendTaskNotification notification) {
        SmsConfigDTO smsConfig = (SmsConfigDTO) notification.getChannelConfig();

//        Map<String, Object> templateParams = notification.getTemplateParams();
//
//        smsSendDomainService.sendSingleSms(
//                smsConfig.getMobile(),
//                notification.getUserId(),
//                notification.getUserType(),
//                smsConfig.getTemplateCode(),
//                templateParams
//        );
    }
}
